/*
 * @Description: 错误状态
 * @Author: chenjiaxin
 * @Date: 2021-12-21 20:00:06
 * @LastEditTime: 2022-01-05 20:32:09
 * @FilePath: \novel-serve\src\constants\error-types.js
 */
const NAME_OR_PASSWORD_IS_REQUIRED = {
  code: 401,
  type: "name_or_password_is_required",
  msg: "用户名或者密码不能为空"
};//名字或者密码不能为空

//注册必传
const REGISTER_IS_REQUIRED = {
  code: 401,
  type: "e_mail_or_password_is_required",
  msg: "邮箱或者密码不能为空"
};

//用户已经存在
const USER_ALREADY_EXISTS = {
  code: 401,
  type: "user_already_exists",
  msg: "用户已经存在"
};
//用户不存在
const USER_DOES_NOT_EXIST = {
  code: 401,
  type: "user_does_not_exists",
  msg: "用户不存在"
};
//密码错误
const PASSWORD_WRONG = {
  code: 401,
  type: "password_wrong",
  msg: "密码错误"
};
//未授权的
const UNAUTHORIZATION = {
  code: 401,
  type: "unauthorization",
  msg: "未授权的"
};
//参数是空的
const PARAM_EMPTY = {
  code: 401,
  type: "param_empty",
  msg: "参数是空的"
}; 


//没有权限
const UNPERMISSION = {
  code: 401,
  type: "unpermission",
  msg: "没有权限"
}; 
//语法错误
const SYNTAX_ERROR = {
  code: 402,
  type: "syntax_error",
  msg: "语法错误"
};
//邮箱格式错误
const E_MAIL_ERROR = {
  code: 401,
  type: "e_mail_error",
  msg: "邮箱格式错误"
};
//token失效了
const TOKEN_INVALID = {
  code: 401,
  type: "token_is_invalid",
  msg: "token失效"
}; 
//token没有传
const NO_TOKEN = {
  code: 401,
  type: "no_token",
  msg: "token没有传"
};
const LACK_PARAM = {
  code: 401,
  type: "lack_param",
  msg: "缺少参数"
};
const LOGIN_CODE_EMAIL_UNEQUAL = {
  code: 401,
  type: "login_code_email_unequal",
  msg: "你的邮箱与接受验证码邮箱不一致"
};
const CODE_ERROR = {
  code: 401,
  type: "code_error",
  msg: "验证码错误"
};
const CODE_LOGIN_ERROR = {
  code: 401,
  type: "code_login_error",
  msg: "邮箱验证码登录错误"
};


module.exports = {
  NAME_OR_PASSWORD_IS_REQUIRED,
  USER_ALREADY_EXISTS,
  USER_DOES_NOT_EXIST,
  PASSWORD_WRONG,
  UNAUTHORIZATION,
  PARAM_EMPTY,
  UNPERMISSION,
  SYNTAX_ERROR,
  E_MAIL_ERROR,
  TOKEN_INVALID,
  REGISTER_IS_REQUIRED,
  NO_TOKEN,
  LACK_PARAM,
  LOGIN_CODE_EMAIL_UNEQUAL,
  CODE_ERROR,
  CODE_LOGIN_ERROR
}